import React, { Component } from 'react'
import { Table, Tag, Space, Button, Modal } from 'antd';
import {connect} from "react-redux"
import {bindActionCreators} from "redux"
import * as action from "../action/tableIndex"
class Dirlog extends Component {

    handleOk() { // 点击弹窗确定时候得方法
        console.log("ok")
        this.props.delFn(this.props.delIndex)
        this.props.delfn(false)
    }
    handleCancel () { // 点击弹窗取消时候得方法
       console.log("cancal")
       this.props.delfn(false)
    }
  render() {
    return (
      <div>
            <Modal title="Basic Modal" visible={this.props.ishow} onOk={this.handleOk.bind(this)} onCancel={this.handleCancel.bind(this)}>
                <p>你确定要删除吗?</p>
            </Modal>
      </div>
    )
  }
}
let mapStateToprops = (state) => {
    return {
      ...state.tablereducer
    }
  }
let mapDsipatchToProps = (dispatch) => bindActionCreators(action, dispatch)
  
export default  connect(mapStateToprops,mapDsipatchToProps)(Dirlog)